import numpy as np
import pandas as pd

from services.aj_info import aj_info as ai
class ajfx:

    def status(self,x):
        return pd.Series([x.count(),x.min(),x.idxmin(),x.quantile(.25),x.median(),
                      x.quantile(.75),x.mean(),x.max(),x.idxmax(),x.mad(),x.var(),
                      x.std(),x.skew(),x.kurt()],index=['总数','最小值','最小值位置','25%分位数',
                    '中位数','75%分位数','均值','最大值','最大值位数','平均绝对偏差','方差','标准差','偏度','峰度'])
    def shrbj(self,strWhere):
        data=ai("sc_ga_aj",strWhere).shrbj()
        return data
    def shrzj(self):
        data=ai("sc_ga_aj").shrzj()
        return data
    def xyrbj(self):
        data=ai("sc_ga_aj").xyrbj()
        return data
    def xyrzj(self):
        data=ai("sc_ga_aj").xyrzj()
        return data
    def ajinfo(self):
        data=ai("sc_ga_aj").ajinfo()
        df=pd.DataFrame(np.array(data),columns=['AJID', 'AJNO', 'OneType', 'TwoType', 'StartTime', 'EndTime','syr','shr','Address','Money','url','syrNoType','syrNo','IMTYPE','IM','AJInfo'])
        return df
